//
//  BillDetailViewController.m
//  YiBaoStore
//
//  Created by 吕清毅 on 2018/10/6.
//  Copyright © 2018年 小河. All rights reserved.
//

#import "BillDetailViewController.h"

@interface BillDetailViewController ()

@end

@implementation BillDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setNavi];
    [self setHeadView];
}


- (void)setHeadView
{
    UIView *headView = [UIView new];
    if (@available(iOS 11.0, *)) {
        headView.frame = CGRectMake(0, TopBarHeight_xs, SCREENWIDTH, 120);
    } else {
        // Fallback on earlier versions
        headView.frame = CGRectMake(0, TopBarHeight, SCREENWIDTH, 120);
    }
    headView.backgroundColor = goldColor;
    [self.view addSubview:headView];
    
    UILabel *titleLab = [UILabel new];
    titleLab.frame = CGRectMake(0, 25, SCREENWIDTH, 14);
    titleLab.textColor = UIColorFromHex(0x020200);
    titleLab.font = FontSemiboldSize(18);
    titleLab.attributedText = [TTKUtil getAtttributeStringWithLineSpace:0 kern:1.5 and:@"充值"];
    titleLab.textAlignment = NSTextAlignmentCenter;
    [headView addSubview:titleLab];
    
    UILabel *numLab = [UILabel new];
    numLab.frame = CGRectMake(0, titleLab.bottom+15, SCREENWIDTH, 14);
    numLab.textColor = UIColorFromHex(0x020200);
    numLab.font = FontSemiboldSize(22);
    numLab.attributedText = [TTKUtil getAtttributeStringWithLineSpace:0 kern:1.83 and:@"+2000"];
    numLab.textAlignment = NSTextAlignmentCenter;
    [headView addSubview:numLab];
    
    UILabel *desLab = [UILabel new];
    desLab.frame = CGRectMake(0, numLab.bottom+15, SCREENWIDTH, 12);
    desLab.textColor = TotalWhite;
    desLab.font = FontWithSize(12);
    desLab.attributedText = [TTKUtil getAtttributeStringWithLineSpace:0 kern:1 and:@"交易成功"];
    desLab.textAlignment = NSTextAlignmentCenter;
    [headView addSubview:desLab];
 
    NSArray *titleArray = @[@"支付方式",@"支付流水",@"创建时间"];
    NSArray *desArray = @[@"微信支付",@"213435435439537453492",@"2018-12-12  12:43"];
    for (int i = 0; i < 3; i++) {
        UILabel *leftLab = [UILabel new];
        leftLab.frame = CGRectMake(15,headView.bottom+20+56*i, 61, 14);
        leftLab.textColor = UIColorFromHex(0x020200);
        leftLab.font = FontWithSize(14);
        leftLab.attributedText = [TTKUtil getAtttributeStringWithLineSpace:0 kern:1.17 and:titleArray[i]];
        [self.view addSubview:leftLab];
        
        UILabel *rightLab = [UILabel new];
        rightLab.frame = CGRectMake(leftLab.right+15, leftLab.top, SCREENWIDTH-91-15, 14);
        rightLab.textColor = UIColorFromHex(0x020200);
        rightLab.font = FontWithSize(14);
        rightLab.attributedText = [TTKUtil getAtttributeStringWithLineSpace:0 kern:1.17 and:desArray[i]];
        rightLab.textAlignment = NSTextAlignmentRight;
        [self.view addSubview:rightLab];
        
        UIView *lineView = [UIView new];
        lineView.frame = CGRectMake(0, headView.bottom+54+56*i, SCREENWIDTH, 2);
        lineView.backgroundColor = UIColorFromHex(0xF1F1F1);
        [self.view addSubview:lineView];
        
    }
}

- (void)setNavi
{
    [self setNaviWith:@"账单详情"];
    UILabel *label = (UILabel *)[self.view viewWithTag:30];
    label.textColor = UIColorFromHex(0x020200);
    label.font = FontWithSize(18);
    label.attributedText = [TTKUtil getAtttributeStringWithLineSpace:0 kern:1.5 and:@"账单详情"];
    label.textAlignment = NSTextAlignmentCenter;
}

@end
